package com.hrp.book.ui.bookshelf

import android.os.Bundle
import android.view.View
import com.hrp.book.R
import com.hrp.book.base.BaseActivity
import com.hrp.book.base.BaseFragment
import com.hrp.book.databinding.FragmentBookShelfBinding
import com.hrp.book.ui.search.SearchFragment

class BookShelfFragment : BaseFragment<FragmentBookShelfBinding, BookShelfModel>() {

    companion object {
        fun newInstance(): BookShelfFragment {
            val args = Bundle()
            val fragment = BookShelfFragment()
            fragment.arguments = args
            return fragment
        }
    }


    override fun getLayoutId(): Int {
        return R.layout.fragment_book_shelf
    }

    override fun onLazyInitView(savedInstanceState: Bundle?) {
        super.onLazyInitView(savedInstanceState)
        binding.fragment = this
    }


    fun search(view: View) {
        if (BaseActivity.isRepeatClick) {
            return
        }
        baseActivity.loadRootFragment(SearchFragment.newInstance())

    }
}